package com.turing.data.scripts.contract.transfer

import com.turing.data.vo.out.review.DependParamsVO
import com.turing.data.vo.out.review.TaskElementVO


class IfMomFof_30173_10_transfer {

    static List< TaskElementVO.DrawResultVO > doConvert(List< TaskElementVO.DrawResultVO > resultVOs, DependParamsVO dependParams){

        for( drawResultVO in resultVOs ) {
                def childTaskSn = drawResultVO.childTaskSn
                if(null == childTaskSn || childTaskSn == ""){
                    continue
                }
            String modelValue = drawResultVO.text

            String REGEX_IS_MOM = /.*为.*MOM.*/

            String REGEX_IS_FOF = /.*为.*FOF.*/

            String REGEX_NOT_FOF = /.*不属于.*MOM.*/

            String REGEX_NOT_MOM = /.*不属于.*FOF.*/

            String REGEX_NOT = /.*不属于.*/

            String REGEX_IS = /.*为.*/

            if (modelValue =~ REGEX_NOT_FOF || modelValue =~ REGEX_NOT_MOM || modelValue =~ REGEX_NOT ) {
                drawResultVO.businessValue = "否"
                drawResultVO.type = 1
                continue
            }

            if (modelValue =~ REGEX_IS_MOM || modelValue =~ REGEX_IS_FOF) {
                drawResultVO.businessValue =  "是"
                drawResultVO.type = 1
                continue
            }

            if (modelValue =~ REGEX_IS ) {
                drawResultVO.businessValue =  "是"
                drawResultVO.type = 1
                continue
            }

            drawResultVO.businessValue = "否"
            drawResultVO.type = 1
        }

        return resultVOs
    }

}
